-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use columns for file name, directory, and state when files are shown as a list in TreeViews. Resolves Dense layout issue #547 #632
Conversation
…as a list in TreeViews. Resolves Dense layout issue Murmele#547
// Draw >. | ||
if (mDrawArrow && index.model()->hasChildren(index)) { | ||
painter->save(); | ||
painter->setRenderHint(QPainter::Antialiasing, true); | ||
|
||
QColor color = opt.palette.color(QPalette::Active, QPalette::BrightText); | ||
if (opt.state & QStyle::State_Selected) | ||
color = | ||
!opt.showDecorationSelected | ||
? opt.palette.color(QPalette::Active, QPalette::WindowText) | ||
: opt.palette.color(QPalette::Active, QPalette::HighlightedText); | ||
|
||
painter->setPen(color); | ||
painter->setBrush(color); | ||
|
||
int x = opt.rect.x() + opt.rect.width() - 3; | ||
int y = opt.rect.y() + (opt.rect.height() / 2); | ||
|
||
QPainterPath path; | ||
path.moveTo(x, y); | ||
path.lineTo(x - 5, y - 3); | ||
path.lineTo(x - 5, y + 3); | ||
path.closeSubpath(); | ||
painter->drawPath(path); | ||
|
||
painter->restore(); | ||
|
||
// Adjust rect to exclude the arrow. | ||
opt.rect.adjust(0, 0, -11, 0); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, can be removed because it will be set always to false in the DoubleTreeWidget
TreeProxy *treewrapperStaged = new TreeProxy(true, this); | ||
treewrapperStaged->setSourceModel(mDiffTreeModel); | ||
stagedFiles->setModel(treewrapperStaged); | ||
stagedFiles->setHeaderHidden(true); | ||
ViewDelegate *stagedDelegate = new ViewDelegate(); | ||
stagedDelegate->setDrawArrow(false); | ||
stagedFiles->setItemDelegateForColumn(0, stagedDelegate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine
TreeProxy *treewrapperUnstaged = new TreeProxy(false, this); | ||
treewrapperUnstaged->setSourceModel(mDiffTreeModel); | ||
unstagedFiles->setModel(treewrapperUnstaged); | ||
unstagedFiles->setHeaderHidden(true); | ||
ViewDelegate *unstagedDelegate = new ViewDelegate(); | ||
unstagedDelegate->setDrawArrow(false); | ||
unstagedFiles->setItemDelegateForColumn(0, unstagedDelegate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine
TreeProxy::TreeProxy(bool staged, QObject *parent) | ||
: QSortFilterProxyModel(parent), mStaged(staged) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine
connect(RepoView::parentView(this)->repo().notifier(), | ||
&git::RepositoryNotifier::referenceUpdated, this, | ||
&TreeView::updateView); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this explicitly? An update comes from the DoubleTreewidget
In your build single column listview is anymore possible, It would be nice to have this possibility |
closed in favour of #664 |
The new list view looks like this: